package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.AutoFill;
import com.ruoyi.common.enums.AutoFillType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DispatchMonitoringItemMapper;
import com.ruoyi.system.domain.DispatchMonitoringItem;
import com.ruoyi.system.service.IDispatchMonitoringItemService;

/**
 * 监测项Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-02
 */
@Service
public class DispatchMonitoringItemServiceImpl implements IDispatchMonitoringItemService 
{
    @Autowired
    private DispatchMonitoringItemMapper dispatchMonitoringItemMapper;

    /**
     * 查询监测项
     * 
     * @param monitoringItemId 监测项主键
     * @return 监测项
     */
    @Override
    public DispatchMonitoringItem selectDispatchMonitoringItemByMonitoringItemId(Long monitoringItemId)
    {
        return dispatchMonitoringItemMapper.selectDispatchMonitoringItemByMonitoringItemId(monitoringItemId);
    }

    /**
     * 查询监测项列表
     * 
     * @param dispatchMonitoringItem 监测项
     * @return 监测项
     */
    @Override
    public List<DispatchMonitoringItem> selectDispatchMonitoringItemList(DispatchMonitoringItem dispatchMonitoringItem)
    {
        return dispatchMonitoringItemMapper.selectDispatchMonitoringItemList(dispatchMonitoringItem);
    }

    /**
     * 新增监测项
     * 
     * @param dispatchMonitoringItem 监测项
     * @return 结果
     */
    @AutoFill(operation = AutoFillType.INSERT)
    @Override
    public int insertDispatchMonitoringItem(DispatchMonitoringItem dispatchMonitoringItem)
    {
        return dispatchMonitoringItemMapper.insertDispatchMonitoringItem(dispatchMonitoringItem);
    }

    /**
     * 修改监测项
     * 
     * @param dispatchMonitoringItem 监测项
     * @return 结果
     */
    @AutoFill(operation = AutoFillType.UPDATE)
    @Override
    public int updateDispatchMonitoringItem(DispatchMonitoringItem dispatchMonitoringItem)
    {
        return dispatchMonitoringItemMapper.updateDispatchMonitoringItem(dispatchMonitoringItem);
    }

    /**
     * 批量删除监测项
     * 
     * @param monitoringItemIds 需要删除的监测项主键
     * @return 结果
     */
    @Override
    public int deleteDispatchMonitoringItemByMonitoringItemIds(Long[] monitoringItemIds)
    {
        return dispatchMonitoringItemMapper.deleteDispatchMonitoringItemByMonitoringItemIds(monitoringItemIds);
    }

    /**
     * 删除监测项信息
     * 
     * @param monitoringItemId 监测项主键
     * @return 结果
     */
    @Override
    public int deleteDispatchMonitoringItemByMonitoringItemId(Long monitoringItemId)
    {
        return dispatchMonitoringItemMapper.deleteDispatchMonitoringItemByMonitoringItemId(monitoringItemId);
    }
}
